﻿using System;
using UnityEngine;
using ZWFrameWork;


public class NetCenter : MonoBehaviour
{
    /// <summary>
    /// 登录大厅服务器
    /// </summary>
    public void LoginToLoginServer()
    {
        // SingletonInstance<GameInfo>.Instance().clearData();
        // SingletonInstance<PlayerInfo>.Instance().clearData();
        Action loginSuccess = () => { GameUtilty.Info("socket连接成功回调"); };
        Action loginFail = () => { GameUtilty.Error("socket错误"); };
        Action<TCP_Command, byte[]> action = (a, b) =>
        {
            SingletonInstance<LogonNetMessageCenter>.Instance().NetMessageDispatch(a, b);
        };
        LogonClient.Instance.Init(loginSuccess, loginFail, action);
        LogonClient.Instance.Connect();
        LogonClient.Instance.SendTCPValidate();
        
    }
}